#ifndef __LEAQ_KERNEL_DEBUGTRACER_H__
#define __LEAQ_KERNEL_DEBUGTRACER_H__

#include <QDebug>

#include "kernel_global.h"

namespace LEAQ {
namespace Kernel {

class LEAQ_KERNEL_EXPORT DebugTracer {
public:
    inline DebugTracer()
        : debug_(new QDebug(QtDebugMsg)) {}

    inline ~DebugTracer() {
        delete debug_;
        debug_ = 0;
    }

    template<typename Ty>
    inline DebugTracer&
    operator<<(const Ty& value) {
        if(debug_) {
            *debug_ << value;
        }

        return *this;
    }

private:
    QDebug* debug_;

};

} //namespace Kernel
} //namespace LEAQ

#endif // __LEAQ_KERNEL_DEBUGLOGGER_H__
